﻿using Appraisal_System.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Appraisal_System
{
    public partial class FrmBaseManager : Form
    {
        public FrmBaseManager()
        {
            InitializeComponent();
        }

        private void FrmBaseManager_Load(object sender, EventArgs e)
        {
            //绑定数据源
            dgvBase.DataSource = AppraisalBases.ListAll();
        }

        /// <summary>
        /// 在窗体的单元格上直接修改数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvBase_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            AppraisalBases dataBoundItem = (AppraisalBases)dgvBase.Rows[e.RowIndex].DataBoundItem;
            AppraisalBases.Update(dataBoundItem);
        }
    }
}
